package xyz.ddlnt.serviceusr.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import xyz.ddlnt.model.entity.Post;
import xyz.ddlnt.model.vo.PostLatestVO;
import xyz.ddlnt.model.vo.PostNodeVO;
import xyz.ddlnt.model.vo.PostVO;

import java.util.List;

/**
 * @author ZZULI_SE 210910
 * @data 2025/5/9 16:52
 */
@Mapper
public interface PostMapper extends BaseMapper<Post> {

    List<PostVO> getPostLists(IPage<PostVO> page);

    List<Post> getBloggerPublish(IPage<Post> page, Long userId);

    List<PostVO> selectPostList(IPage<PostVO> page, String searchValue);

    @Select("SELECT id, post_title FROM post WHERE user_id = #{bloggerId} ")
    List<PostLatestVO> selectPostLatestList(IPage<PostVO> page, Long bloggerId);

    PostVO getPost(Long id);
}

